package seeders

import (
	"github.com/goravel/framework/facades"
	"goravel/app/models"
)

type CarSeeder struct {
}

// Signature The name and signature of the seeder.
func (s *CarSeeder) Signature() string {
	return "CarSeeder"
}

// Run executes the seeder logic.
func (s *CarSeeder) Run() error {
	cars := []models.Car{
		{
			Serial:      "T1311",
			KindID:      15,
			Inspection:  "5-20",
			Maintenance: "5-20",
			State:       "1",
		},
		{
			Serial:      "Q3039",
			KindID:      17,
			Inspection:  "5-20",
			Maintenance: "5-20",
			State:       "1",
		},
		{
			Serial:      "湛钢J0273",
			KindID:      19,
			Inspection:  "5-20",
			Maintenance: "5-20",
			State:       "1",
		},
		{
			Serial:      "湛钢J0216",
			KindID:      13,
			Inspection:  "5-20",
			Maintenance: "5-20",
			State:       "1",
		},
	}
	return facades.Orm().Query().Model(&models.Car{}).Create(&cars)
}
